package com.kob.backend.controller.shopcarts;

import com.kob.backend.pojo.product;
import com.kob.backend.service.shopcarts.ShopcartsGetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class ShopcartsGetController {
    @Autowired
    private ShopcartsGetService shopcartsGetService;
    @GetMapping("/shopcarts/get/")
    public List<product> getshopcarts(@RequestParam Map<String,String> map){
        Integer userid = Integer.parseInt(map.get("userid"));
        return shopcartsGetService.getshopcarts(userid);
    }
}
